**** OPEN OUTPUT LOG FILE  *****


log using "C:\Users\gk57526\Dropbox\Administration of UI Programs in the American States (Ji-Hyeun Hong)\Performance Management Project (Paper #3)\EMPIRICS\OUTPUT\Performance Management.MANUSCRIPT MODELS.04-10-2025.smcl", replace 




**** OPEN STATISTICAL DATABASE FILE [07-10-2024]  *****

use "C:\Users\gk57526\Dropbox\Administration of UI Programs in the American States (Ji-Hyeun Hong)\Performance Management Project (Paper #3)\EMPIRICS\DATA\Performance Management.STATISTICAL DATABASE.07-10-2024.dta", replace



*** SET DATA TO PANEL STRUCTURE  ***

xtset stateid monthyear, monthly

*
*
*
*


** GENERATE NATURAL LOGARITHM VERSIONS OF function_sup_avgsalreal [AVERAGE REAL SALARY IN UIP AGENCY MANAGERIAL POSITIONS] & uiadmin_budget_real [REAL AGENCY BUDGET] **

gen ln_function_sup_avgsalreal = ln(function_sup_avgsalreal)
*
gen ln_uiadmin_budget_real = ln(uiadmin_budget_real)




*****************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************



*** COMPUTE CATEGORICAL TASK COMPLEXITY COVARIATE MEASURES [CONDITIONAL ADAPTATION TO IT MODERNIZATION REFORMS] ***

** PURPOSE: COMPUTE MARGINAL DIFFERENTIAL EFFECTS IN MANUSCRIPT MODELS [BASED ON EFFECTIVE SAMPLE OF OBSERVATIONS] **



** (1) INTERSTATE CASE RATES [PAID & DENIED CLAIMS SAMPLES: TOTAL ERROR RATE & RELATIVE TYPE I ERROR RATE [MODELS 1 & 3];  PAID CLAIMS SAMPLE ONLY: ABSOLUTE TYPE I ERROR RATE [MODEL 2] **


* Overall Program Error Rate *

quietly reg totalerror_rat  itmod_monthcount  tot_interstate    tot_diffoccupseek demgovparty repgovparty ln_workload automationrate ln_uiadmin_budget_real benefitgenerosity2 unemp_rate ln_function_sup_avgsalreal  tot_totalnonwhite_rat tot_totalfemale_rat tot_totalageu25o65_rat  i.stateid i.year adoptcohort_2004_itadopt  adoptcohort_2006_itadopt adoptcohort_2007_itadopt   adoptcohort_2009_itadopt  adoptcohort_2010_itadopt  adoptcohort_2013_itadopt  adoptcohort_2014_itadopt  adoptcohort_2015_itadopt  adoptcohort_2016_itadopt  adoptcohort_2017_itadopt  adoptcohort_2018_itadopt  adoptcohort_2020_itadopt  adoptcohort_2021_itadopt  if itmod_adopt_state==1
*
*
sum tot_interstate if e(sample), detail
di r(p75)
di r(p25)
*
gen tot_interstate_cat =.
replace tot_interstate_cat = 0 if tot_interstate<= r(p25) 
replace tot_interstate_cat = 1 if tot_interstate> r(p25) & tot_interstate < r(p75) 
replace tot_interstate_cat = 2 if tot_interstate>= r(p75) 
*
tab tot_interstate_cat
tab tot_interstate_cat if itmod_adopt_state==1

*
*
*

* Absolute Type I Error Rate *

quietly reg t1error_rat  itmod_monthcount  t1_interstate    t1_diffoccupseek demgovparty repgovparty ln_workload automationrate ln_uiadmin_budget_real benefitgenerosity2 unemp_rate ln_function_sup_avgsalreal  t1_totalnonwhite_rat t1_totalfemale_rat t1_totalageu25o65_rat  i.stateid i.year adoptcohort_2004_itadopt  adoptcohort_2006_itadopt adoptcohort_2007_itadopt   adoptcohort_2009_itadopt  adoptcohort_2010_itadopt  adoptcohort_2013_itadopt  adoptcohort_2014_itadopt  adoptcohort_2015_itadopt  adoptcohort_2016_itadopt  adoptcohort_2017_itadopt  adoptcohort_2018_itadopt  adoptcohort_2020_itadopt  adoptcohort_2021_itadopt  if itmod_adopt_state==1
*
*
sum t1_interstate if e(sample), detail
di r(p75)
di r(p25)
*
gen t1_interstate_cat =.
replace t1_interstate_cat = 0 if t1_interstate<= r(p25) 
replace t1_interstate_cat = 1 if t1_interstate> r(p25) & t1_interstate < r(p75) 
replace t1_interstate_cat = 2 if t1_interstate>= r(p75) 
*
tab t1_interstate_cat
tab t1_interstate_cat if itmod_adopt_state==1
*
*
*

* Relative Type I Error Rate [same as Overall Program Error Rate since Contains Both Type I & Type II Program Error Rates] *

quietly reg relt1error_rat  itmod_monthcount  tot_interstate    tot_diffoccupseek demgovparty repgovparty ln_workload automationrate ln_uiadmin_budget_real benefitgenerosity2 unemp_rate ln_function_sup_avgsalreal  tot_totalnonwhite_rat tot_totalfemale_rat tot_totalageu25o65_rat  i.stateid i.year adoptcohort_2004_itadopt  adoptcohort_2006_itadopt adoptcohort_2007_itadopt   adoptcohort_2009_itadopt  adoptcohort_2010_itadopt  adoptcohort_2013_itadopt  adoptcohort_2014_itadopt  adoptcohort_2015_itadopt  adoptcohort_2016_itadopt  adoptcohort_2017_itadopt  adoptcohort_2018_itadopt  adoptcohort_2020_itadopt  adoptcohort_2021_itadopt  if itmod_adopt_state==1
*
*
sum tot_interstate if e(sample), detail
di r(p75)
di r(p25)
*
gen relt1_interstate_cat =.
replace relt1_interstate_cat = 0 if tot_interstate<= r(p25) 
replace relt1_interstate_cat = 1 if tot_interstate> r(p25) & tot_interstate < r(p75) 
replace relt1_interstate_cat = 2 if tot_interstate>= r(p75) 
*
tab relt1_interstate_cat
tab relt1_interstate_cat if itmod_adopt_state==1
*



*****************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************



** (2) DIFFERENT OCCUPATION SEEKING RATE [PAID & DENIED CLAIMS SAMPLES: TOTAL ERROR RATE & RELATIVE TYPE I ERROR RATE [MODELS 1 & 3];  PAID CLAIMS SAMPLE ONLY: ABSOLUTE TYPE I ERROR RATE [MODEL 2] **


* Overall Program Error Rate *

quietly reg totalerror_rat  itmod_monthcount  tot_interstate    tot_diffoccupseek demgovparty repgovparty ln_workload automationrate ln_uiadmin_budget_real benefitgenerosity2 unemp_rate ln_function_sup_avgsalreal  tot_totalnonwhite_rat tot_totalfemale_rat tot_totalageu25o65_rat  i.stateid i.year  adoptcohort_2002_itadopt  adoptcohort_2004_itadopt  adoptcohort_2006_itadopt adoptcohort_2007_itadopt   adoptcohort_2009_itadopt  adoptcohort_2010_itadopt  adoptcohort_2013_itadopt  adoptcohort_2014_itadopt  adoptcohort_2015_itadopt  adoptcohort_2016_itadopt  adoptcohort_2017_itadopt  adoptcohort_2018_itadopt  adoptcohort_2020_itadopt  adoptcohort_2021_itadopt  if itmod_adopt_state==1

sum tot_diffoccupseek if e(sample), detail
di r(p75)
di r(p25)
*
gen tot_diffoccupseek_cat =.
replace tot_diffoccupseek_cat = 0 if tot_diffoccupseek<= r(p25) 
replace tot_diffoccupseek_cat = 1 if tot_diffoccupseek> r(p25) & tot_diffoccupseek < r(p75) 
replace tot_diffoccupseek_cat = 2 if tot_diffoccupseek>= r(p75) 
*
tab tot_diffoccupseek_cat
tab tot_diffoccupseek_cat if itmod_adopt_state==1

*
*
*

* Absolute Type I Error Rate *

quietly reg t1error_rat  itmod_monthcount  t1_interstate    t1_diffoccupseek demgovparty repgovparty ln_workload automationrate ln_uiadmin_budget_real benefitgenerosity2 unemp_rate ln_function_sup_avgsalreal  t1_totalnonwhite_rat t1_totalfemale_rat t1_totalageu25o65_rat  i.stateid i.year  adoptcohort_2002_itadopt  adoptcohort_2004_itadopt  adoptcohort_2006_itadopt adoptcohort_2007_itadopt   adoptcohort_2009_itadopt  adoptcohort_2010_itadopt  adoptcohort_2013_itadopt  adoptcohort_2014_itadopt  adoptcohort_2015_itadopt  adoptcohort_2016_itadopt  adoptcohort_2017_itadopt  adoptcohort_2018_itadopt  adoptcohort_2020_itadopt  adoptcohort_2021_itadopt  if itmod_adopt_state==1
*
*
sum t1_diffoccupseek if e(sample), detail
di r(p75)
di r(p25)
*
gen t1_diffoccupseek_cat =.
replace t1_diffoccupseek_cat = 0 if t1_diffoccupseek<= r(p25) 
replace t1_diffoccupseek_cat = 1 if t1_diffoccupseek> r(p25) & t1_diffoccupseek < r(p75) 
replace t1_diffoccupseek_cat = 2 if t1_diffoccupseek>= r(p75) 
*
tab t1_diffoccupseek_cat
tab t1_diffoccupseek_cat if itmod_adopt_state==1
*
*
*

* Relative Type I Error Rate [same as Overall Program Error Rate since Contains Both Type I & Type II Program Error Rates] *

quietly reg relt1error_rat  itmod_monthcount  tot_interstate    tot_diffoccupseek demgovparty repgovparty ln_workload automationrate ln_uiadmin_budget_real benefitgenerosity2 unemp_rate ln_function_sup_avgsalreal  tot_totalnonwhite_rat tot_totalfemale_rat tot_totalageu25o65_rat  i.stateid i.year   adoptcohort_2002_itadopt  adoptcohort_2004_itadopt  adoptcohort_2006_itadopt adoptcohort_2007_itadopt   adoptcohort_2009_itadopt  adoptcohort_2010_itadopt  adoptcohort_2013_itadopt  adoptcohort_2014_itadopt  adoptcohort_2015_itadopt  adoptcohort_2016_itadopt  adoptcohort_2017_itadopt  adoptcohort_2018_itadopt  adoptcohort_2020_itadopt  adoptcohort_2021_itadopt  if itmod_adopt_state==1
*
*
sum tot_diffoccupseek if e(sample), detail
di r(p75)
di r(p25)
*
gen relt1_diffoccupseek_cat =.
replace relt1_diffoccupseek_cat = 0 if tot_diffoccupseek<= r(p25) 
replace relt1_diffoccupseek_cat = 1 if tot_diffoccupseek> r(p25) & tot_diffoccupseek < r(p75) 
replace relt1_diffoccupseek_cat = 2 if tot_diffoccupseek>= r(p75) 
*
tab relt1_diffoccupseek_cat
tab relt1_diffoccupseek_cat if itmod_adopt_state==1


**************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************

 

*** SAVE MANUSCRIPT DATABASE [as of 04-10-2025] ***


save "C:\Users\gk57526\Dropbox\Administration of UI Programs in the American States (Ji-Hyeun Hong)\Performance Management Project (Paper #3)\EMPIRICS\DATA\Performance Management.MANUSCRIPT DATABASE.04-10-2025.dta", replace




*** MANUSCRIPT MODELS [TABLE 1; FIGURES 3-5] ***





********************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************






*** MODELS PREDICTING VARIOPUS TYPE OF PROGRAM ERROR RATES BASED ON BAM SAMPLING RATES ***





*** MODEL 1: OVERALL ERROR RATE: (SAMPLE WEIGHTED) ***

*  [# overpayment errors / paid claims sample] + [# underpayment errors / paid claims sample] + [# erroneous denials / denied claims sample] + [# underpayment errors / denied claims sample] *



*** MODEL 2: ABSOLUTE TYPE I ERROR RATE ***

* [overpayment error rate / paid claims sample] *




*** MODEL 3: RELATIVE TYPE I ERROR RATE:  {TYPE I ERROR RATE /  [TYPE I ERROR RATE + TYPE II ERROR RATE]}      (SAMPLE WEIGHTED)  ***

*  {[overpayment error rate / paid claims sample]   /  [overpayment error rate / paid claims sample]   +  [underpayment error rate / paid claims sample]  +  [erroneous denial / denied claims sample]  +  [underpayment error / denied claims sample]}  *






********************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************






*** RETRIEVE MANUSCRIPT DATABASE [as of 04-10-2025] ***

use "C:\Users\gk57526\Dropbox\Administration of UI Programs in the American States (Ji-Hyeun Hong)\Performance Management Project (Paper #3)\EMPIRICS\DATA\Performance Management.MANUSCRIPT DATABASE.04-10-2025.dta", replace




*** SET DATA TO PANEL STRUCTURE  ***

xtset stateid monthyear, monthly

*
*
*
*



********************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************




*** DESCRIPTIVE STATISTICS FOR DEPENDENT VARIABLE BASED ON EFFECTIVE REGRESSION SAMPLE [PLEASE NOTE: ALL DESCRIPTIVE STATISTICS ARE BASED ON OVERALL PROGRAM ERROR RATE SAMPLE OF OBSERVATIONS: N*T = 7,000] ***



** DEPENDENT VARIABLES **

sum totalerror_rat t1error_rat  relt1error_rat  if itmod_adopt_state==1 & !missing(totalerror_rat), detail



** ORGANIZATIONAL ADAPTATION COVARIATE **

sum itmod_monthcount if itmod_adopt_state==1 & !missing(totalerror_rat), detail



** CONTROL COVARIATES [EXCLUDING UNIT EFFECTS] *** tot: Models 1, 3, and 4// t1: Model 2 (Type I)

sum demgovparty repgovparty ln_workload automationrate ln_uiadmin_budget_real benefitgenerosity2 unemp_rate ln_function_sup_avgsalreal tot_totalnonwhite_rat tot_totalfemale_rat tot_totalageu25o65_rat t1_totalnonwhite_rat t1_totalfemale_rat t1_totalageu25o65_rat if itmod_adopt_state==1  & !missing(totalerror_rat), detail





********************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************






**** TABLE 1 -- MODELS 1-3: "TASK COMPLEXITY, ORGANIZATIONAL ADAPTATION & PROGRAM ERROR RATES" MANUSCRIPT STATISTICAL ANALYSES [APRIL 2025]: ORGANIZATIONAL ADAPTATION EFFECTS ON PROGRAM PAYMENT ERROR RATES [M1: TOTAL PROGRAM ERROR RATE; M2: ABSOLUTE TYPE I PROGRAM ERROR RATE; M3: RELATIVE TYPE I PROGRAM ERROR RATE] **** 


** (MODEL 1; FIGURES 3A-3C; MODEL 2: FIGURES 4A-4C; MODEL 3: FIGURES 4D-4F) **




************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************
************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************




*** TESTING H1 & H3: TOTAL/OVERALL PROGRAM ERROR RATE ORGANIZATIONAL ADAPTATION  ***



*** ESTIMATE MODEL 1: TOTAL PROGRAM ERROR  RATE [PROPORTION OF SAMPLE-WEIGHTED CASES OF TOTAL ERRORS VIA WEEKLY BAM SURVEY AGGREGATED TO MONTHLY OBSERVATIONS: [CONTROLS, PLUS STATE, YEAR, AND YEAR-ADOPTION COHORT*TREATMENT UNIT EFFECTS] *** 	(FIGURES 3A-3C) 

npregress series totalerror_rat  itmod_monthcount  i.tot_interstate_cat   i.tot_diffoccupseek_cat   if itmod_adopt_state==1, asis(demgovparty repgovparty ln_workload automationrate ln_uiadmin_budget_real benefitgenerosity2 unemp_rate ln_function_sup_avgsalreal  tot_totalnonwhite_rat tot_totalfemale_rat tot_totalageu25o65_rat    i.stateid i.year  adoptcohort_2002_itadopt  adoptcohort_2004_itadopt  adoptcohort_2006_itadopt adoptcohort_2007_itadopt   adoptcohort_2009_itadopt  adoptcohort_2010_itadopt  adoptcohort_2013_itadopt  adoptcohort_2014_itadopt  adoptcohort_2015_itadopt  adoptcohort_2016_itadopt  adoptcohort_2017_itadopt  adoptcohort_2018_itadopt  adoptcohort_2020_itadopt  adoptcohort_2021_itadopt)  vce(bootstrap, seed(123) rep(1000))
*
*
*

** COMPUTE PSEUDO R^2 [SSE / (SSE + SSR) = EXPLAINED/PREDICTED SUM OF SQUARES / (EXPLAINED/PREDICTED SUM OF SQUARES + RESIDUAL SUM OF SQUARES)] = SSE / SST

predict predsy_m1 if e(sample)
predict residsy_m1 if e(sample), residuals

gen sse_m1 = predsy_m1 * predsy_m1 if e(sample)
gen ssr_m1 = residsy_m1 * residsy_m1 if e(sample)

egen sum_sse_m1 = total(sse_m1) if e(sample)
egen sum_ssr_m1 = total(ssr_m1) if e(sample)

gen r2_m1 = sum_ssr_m1/(sum_sse_m1 + sum_ssr_m1)

sum r2_m1



* [MODEL 1: TOTAL ERROR  RATE] FIGURE 3A:  UNCONDITIONAL ADAPTATION EFFECTS -- E(Y) [WITH RESPECT TO MONTHS SINCE ADOPTION (t + k) : 0 1 6 12.....60]

margins, at(itmod_monthcount=(0 1 6 12 18 24 30 36 42 48 54 60))

marginsplot, recast(connected) ciopt(color(%40)) recastci(rarea) ///
legend(on order(1 "Unconditional Adaptation") pos(6) ring(2) cols(2) size(9pt))  ///
title(" {bf:FIGURE 3A}""{bf:Unconditional Adaptation Effect}" "{bf:(Total Program Error Rate [MODEL 1])}", size(10pt) linegap(0.7) margin(t+1 b+2 r-6)) ///
xtitle("Months since IT Reform", size(10pt) margin(t+2 b+2)) ///
ytitle("Total Program Error Rate", size(10pt) margin(r+2)) ///
xlabel(0 "0" 1 "1" 6 "6" 12 "12" 18 "18" 24 "24" 30 "30" 36 "36" 42 "42" 48 "48" 54 "54" 60 "60", labsize(9pt) ) ///
ylabel(, labsize(9pt) format(%9.2f) angle(0)) xsize(6)
*
*
graph save "Graph" "C:\Users\gk57526\Dropbox\Administration of UI Programs in the American States (Ji-Hyeun Hong)\Performance Management Project (Paper #3)\EMPIRICS\GRAPHICS\marginsplot.Model 1.FIGURE 3A.04-10-2025.gph", replace

*
*
*
*

* [MODEL 1: TOTAL PROGRAM ERROR  RATE] FIGURE 3B:  MARGINAL DIFFERENTIAL EFFECT BETWEEN HIGH TASK COMPLEXITY (tot_interstate_cat==2) & LOW COMPLEXITY (tot_interstate_cat==0) VALUES [WITH RESPECT TO MONTHS SINCE ADOPTION (t + k) : 0 1 6 12.....60]: ***

margins r.tot_interstate_cat if tot_interstate_cat==0|tot_interstate_cat==2, at(itmod_monthcount=(0 1 6 12 18 24 30 36 42 48 54 60))

marginsplot, recast(connected) ciopt(color(%40)) recastci(rarea) /// 
yline(0, lcolor(%40gs) lpattern(shortdash)) ///
legend(on order(1 "High Task Complexity - Low Task Complexity") pos(6) ring(2) cols(2) size(10pt))  ///
title(" {bf:FIGURE 3B}""{bf:Conditional Adaptation Marginal Effect By Task Complexity}" "{bf:(Interstate Claims: Total Program Error Rate [MODEL 1])}", size(10pt) linegap(0.7) margin(t+1 b+1 r-6)) ///
xtitle("Months since IT Reform", size(10pt) margin(t+2 b+2)) ///
ytitle("Total Program Error Rate", size(10pt) margin(r+2)) ///
xlabel(0 "0" 1 "1" 6 "6" 12 "12" 18 "18" 24 "24" 30 "30" 36 "36" 42 "42" 48 "48" 54 "54" 60 "60", labsize(9pt) ) ///
ylabel(, labsize(9pt) format(%9.2f) angle(0)) xsize(6)
*
*
*
graph save "Graph" "C:\Users\gk57526\Dropbox\Administration of UI Programs in the American States (Ji-Hyeun Hong)\Performance Management Project (Paper #3)\EMPIRICS\GRAPHICS\marginsplot.Model 1.FIGURE 3B.04-10-2025.gph", replace
*
*
*
* [MODEL 1: TOTAL PROGRAM ERROR  RATE] FIGURE 3C:  MARGINAL DIFFERENTIAL EFFECT BETWEEN HIGH TASK COMPLEXITY (tot_diffoccupseek_cat==2) & LOW COMPLEXITY (tot_extbenefits_cat==0) VALUES [WITH RESPECT TO MONTHS SINCE ADOPTION (t + k) : 0 1 6 12.....60]: ***

margins r.tot_diffoccupseek_cat if tot_diffoccupseek_cat==0|tot_diffoccupseek_cat==2, at(itmod_monthcount=(0 1 6 12 18 24 30 36 42 48 54 60))

marginsplot, recast(connected) ciopt(color(%40)) recastci(rarea) /// 
yline(0, lcolor(%40gs) lpattern(shortdash)) ///
legend(on order(1 "High Task Complexity - Low Task Complexity") pos(6) ring(2) cols(2) size(10pt))  ///
title(" {bf:FIGURE 3C}""{bf:Conditional Adaptation Marginal Effect By Task Complexity}" "{bf:(Seeking Different Occupation: Total Program Error Rate [MODEL 1])}", size(10pt) linegap(0.7) margin(t+1 b+1 r-6)) ///
xtitle("Months since IT Reform", size(10pt) margin(t+2 b+2)) ///
ytitle("Total Program Error Rate", size(10pt) margin(r+2)) ///
xlabel(0 "0" 1 "1" 6 "6" 12 "12" 18 "18" 24 "24" 30 "30" 36 "36" 42 "42" 48 "48" 54 "54" 60 "60", labsize(9pt) ) ///
ylabel(, labsize(9pt) format(%9.2f) angle(0)) xsize(6)
*
*
*
graph save "Graph" "C:\Users\gk57526\Dropbox\Administration of UI Programs in the American States (Ji-Hyeun Hong)\Performance Management Project (Paper #3)\EMPIRICS\GRAPHICS\marginsplot.Model 1.FIGURE 3C.04-10-2025.gph", replace


****************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************
****************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************
****************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************




*** TESTING H2 & H4: ABSOLUTE TYPE I PROGRAM ERROR RATE ORGANIZATIONAL ADAPTATION  ***



*** ESTIMATE MODEL 2: TYPE I PROGRAM ERROR RATE [PROPORTION OF TOTAL ERRORS VIA WEEKLY BAM SURVEY AGGREGATED TO MONTHLY OBSERVATIONS: [ONLY STATE, YEAR, AND YEAR-ADOPTION COHORT*TREATMENT UNIT EFFECTS] *** (FIGURES 4A-4C) 


npregress series t1error_rat  itmod_monthcount  i.t1_interstate_cat    i.t1_diffoccupseek_cat   if itmod_adopt_state==1, asis(demgovparty repgovparty ln_workload automationrate ln_uiadmin_budget_real benefitgenerosity2 unemp_rate ln_function_sup_avgsalreal  t1_totalnonwhite_rat t1_totalfemale_rat t1_totalageu25o65_rat    i.stateid i.year     adoptcohort_2002_itadopt  adoptcohort_2004_itadopt  adoptcohort_2006_itadopt adoptcohort_2007_itadopt   adoptcohort_2009_itadopt  adoptcohort_2010_itadopt  adoptcohort_2013_itadopt  adoptcohort_2014_itadopt adoptcohort_2015_itadopt  adoptcohort_2016_itadopt  adoptcohort_2017_itadopt  adoptcohort_2018_itadopt  adoptcohort_2020_itadopt  adoptcohort_2021_itadopt)  vce(bootstrap, seed(123) rep(1000))
*
*
*

** COMPUTE PSEUDO R^2 [SSE / (SSE + SSR) = EXPLAINED/PREDICTED SUM OF SQUARES / (EXPLAINED/PREDICTED SUM OF SQUARES + RESIDUAL SUM OF SQUARES)] = SSE / SST

predict predsy_m2 if e(sample)
predict residsy_m2 if e(sample), residuals

gen sse_m2 = predsy_m2 * predsy_m2 if e(sample)
gen ssr_m2 = residsy_m2 * residsy_m2 if e(sample)

egen sum_sse_m2 = total(sse_m2) if e(sample)
egen sum_ssr_m2 = total(ssr_m2) if e(sample)

gen r2_m2 = sum_ssr_m2/(sum_sse_m2 + sum_ssr_m2)

sum r2_m2



* [MODEL 2: TYPE I PROGRAM ERROR RATE] FIGURE 4A: UNCONDITIONAL ADAPTATION EFFECTS -- E(Y) [WITH RESPECT TO MONTHS SINCE ADOPTION (t + k) : 0 1 6 12.....60]

margins, at(itmod_monthcount=(0 1 6 12 18 24 30 36 42 48 54 60))

marginsplot, recast(connected) ciopt(color(%40)) recastci(rarea) ///
legend(on order(1 "Unconditional Adaptation") pos(6) ring(2) cols(2) size(9pt))  ///
title(" {bf:FIGURE 4A}""{bf:Unconditional Adaptation Effect}" "{bf:(Absolute Type I Program Error Rate [MODEL 2])}", size(10pt) linegap(0.7) margin(t+1 b+2 r-6)) ///
xtitle("Months since IT Reform", size(10pt) margin(t+2 b+2)) ///
ytitle("Absolute Type I Program Error Rate", size(10pt) margin(r+2)) ///
xlabel(0 "0" 1 "1" 6 "6" 12 "12" 18 "18" 24 "24" 30 "30" 36 "36" 42 "42" 48 "48" 54 "54" 60 "60", labsize(9pt) ) ///
ylabel(, labsize(9pt) format(%9.2f) angle(0)) xsize(6)
*
*
graph save "Graph" "C:\Users\gk57526\Dropbox\Administration of UI Programs in the American States (Ji-Hyeun Hong)\Performance Management Project (Paper #3)\EMPIRICS\GRAPHICS\marginsplot.Model 2.FIGURE 4A.04-10-2025.gph", replace


*
*
*
*

* [MODEL 2: ABSOLUTE TYPE I PROGRAM ERROR RATE] FIGURE 4B:  MARGINAL DIFFERENTIAL EFFECT BETWEEN HIGH TASK COMPLEXITY (t1_interstate_cat==2) & LOW COMPLEXITY (t1_interstate_cat==0) VALUES [WITH RESPECT TO MONTHS SINCE ADOPTION (t + k) : 0 1 6 12.....60]: ***

margins r.t1_interstate_cat if t1_interstate_cat==0|t1_interstate_cat==2, at(itmod_monthcount=(0 1 6 12 18 24 30 36 42 48 54 60))

marginsplot, recast(connected) ciopt(color(%40)) recastci(rarea) /// 
yline(0, lcolor(%40gs) lpattern(shortdash)) ///
legend(on order(1 "High Task Complexity - Low Task Complexity") pos(6) ring(2) cols(2) size(10pt))  ///
title(" {bf:FIGURE 4B}""{bf:Conditional Adaptation Marginal Effect By Task Complexity}" "{bf:(Interstate Claims: Absolute Type I Program Error Rate [MODEL 2])}", size(10pt) linegap(0.7) margin(t+1 b+1 r-6)) ///
xtitle("Months since Adoption", size(10pt) margin(t+2 b+2)) ///
ytitle("Absolute Type I Program Error Rate", size(10pt) margin(r+2)) ///
xlabel(0 "0" 1 "1" 6 "6" 12 "12" 18 "18" 24 "24" 30 "30" 36 "36" 42 "42" 48 "48" 54 "54" 60 "60", labsize(9pt) ) ///
ylabel(#3, labsize(9pt) format(%9.2f) angle(0)) xsize(6)
*
*
*
graph save "Graph" "C:\Users\gk57526\Dropbox\Administration of UI Programs in the American States (Ji-Hyeun Hong)\Performance Management Project (Paper #3)\EMPIRICS\GRAPHICS\marginsplot.Model 2.FIGURE 4B.04-10-2025.gph", replace
*
*
*
*
*
* [MODEL 2: ABSOLUTE TYPE I PROGRAM ERROR RATE] FIGURE 4C:  MARGINAL DIFFERENTIAL EFFECT BETWEEN HIGH TASK COMPLEXITY (t1_diffoccupseek_cat==2) & LOW COMPLEXITY (t1_extbenefits_cat==0) VALUES [WITH RESPECT TO MONTHS SINCE ADOPTION (t + k) : 0 1 6 12.....60]: ***

margins r.t1_diffoccupseek_cat if t1_diffoccupseek_cat==0|t1_diffoccupseek_cat==2, at(itmod_monthcount=(0 1 6 12 18 24 30 36 42 48 54 60))

marginsplot, recast(connected) ciopt(color(%40)) recastci(rarea) /// 
yline(0, lcolor(%40gs) lpattern(shortdash)) ///
legend(on order(1 "High Task Complexity - Low Task Complexity") pos(6) ring(2) cols(2) size(10pt))  ///
title(" {bf:FIGURE 4C}""{bf:Conditional Adaptation Marginal Effect By Task Complexity}" "{bf:(Seeking Different Occupation: Absolute Type I Program Error Rate [MODEL 2])}", size(10pt) linegap(0.7) margin(t+1 b+1 r-6)) ///
xtitle("Months since IT Reform", size(10pt) margin(t+2 b+2)) ///
ytitle("Absolute Type I Program Error Rate", size(10pt) margin(r+2)) ///
xlabel(0 "0" 1 "1" 6 "6" 12 "12" 18 "18" 24 "24" 30 "30" 36 "36" 42 "42" 48 "48" 54 "54" 60 "60", labsize(9pt) ) ///
ylabel(#3, labsize(9pt) format(%9.2f) angle(0)) xsize(6)
*
*
*
graph save "Graph" "C:\Users\gk57526\Dropbox\Administration of UI Programs in the American States (Ji-Hyeun Hong)\Performance Management Project (Paper #3)\EMPIRICS\GRAPHICS\marginsplot.Model 2.FIGURE 4C.04-10-2025.gph", replace


****************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************
*************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************
*************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************
*************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************
*************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************
*************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************
*************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************





*** TESTING H2 & H4: RELATIVE TYPE I PROGRAM ERROR RATE [TYPE I ERROR RATE / (TYPE I ERROR RATE + TYPE II ERROR RATE)] ORGANIZATIONAL ADAPTATION ***




*** ESTIMATE MODEL 3: RELATIVE TYPE I PROGRAM ERROR RATE [WITH ADDITIONAL COVARIATES: PROPORTION OF SAMPLE-WEIGHTED CASES OF TOTAL ERRORS VIA WEEKLY BAM SURVEY AGGREGATED TO MONTHLY OBSERVATIONS: [ONLY STATE, YEAR, AND YEAR-ADOPTION COHORT*TREATMENT UNIT EFFECTS] ***  (FIGURES 4D-4F) 


npregress series relt1error_rat   itmod_monthcount  i.relt1_interstate_cat   i.relt1_diffoccupseek_cat    if itmod_adopt_state==1, asis(demgovparty repgovparty ln_workload automationrate ln_uiadmin_budget_real benefitgenerosity2 unemp_rate ln_function_sup_avgsalreal tot_totalnonwhite_rat tot_totalfemale_rat tot_totalageu25o65_rat  i.stateid i.year  adoptcohort_2002_itadopt  adoptcohort_2004_itadopt  adoptcohort_2006_itadopt adoptcohort_2007_itadopt   adoptcohort_2009_itadopt  adoptcohort_2010_itadopt  adoptcohort_2013_itadopt  adoptcohort_2014_itadopt  adoptcohort_2015_itadopt  adoptcohort_2016_itadopt  adoptcohort_2017_itadopt  adoptcohort_2018_itadopt  adoptcohort_2020_itadopt  adoptcohort_2021_itadopt) vce(bootstrap, seed(123) rep(1000))
*
*
*
*

** COMPUTE PSEUDO R^2 [SSE / (SSE + SSR) = EXPLAINED/PREDICTED SUM OF SQUARES / (EXPLAINED/PREDICTED SUM OF SQUARES + RESIDUAL SUM OF SQUARES)] = SSE / SST

predict predsy_m3 if e(sample)
predict residsy_m3 if e(sample), residuals

gen sse_m3 = predsy_m3 * predsy_m3 if e(sample)
gen ssr_m3 = residsy_m3 * residsy_m3 if e(sample)

egen sum_sse_m3 = total(sse_m3) if e(sample)
egen sum_ssr_m3 = total(ssr_m3) if e(sample)

gen r2_m3 = sum_ssr_m3/(sum_sse_m3 + sum_ssr_m3)

sum r2_m3


* [MODEL 3: RELATIVE TYPE I PROGRAM ERROR RATE] FIGURE 4D: UNCONDITIONAL ADAPTATION EFFECTS --  E(Y) [WITH RESPECT TO MONTHS SINCE ADOPTION (t + k) : 0 1 6 12.....60]

margins, at(itmod_monthcount=(0 1 6 12 18 24 30 36 42 48 54 60))

marginsplot, recast(connected) ciopt(color(%40)) recastci(rarea) ///
legend(on order(1 "Unconditional Adaptation") pos(6) ring(2) cols(2) size(9pt))  ///
title(" {bf:FIGURE 4D}""{bf:Unconditional Adaptation Effect}" "{bf:(Relative Type I Program Error Rate [MODEL 3])}", size(10pt) linegap(0.7) margin(t+1 b+2 r-6)) ///
xtitle("Months since IT Reform", size(10pt) margin(t+2 b+2)) ///
ytitle("Relative Type I Program Error Rate", size(10pt) margin(r+2)) ///
xlabel(0 "0" 1 "1" 6 "6" 12 "12" 18 "18" 24 "24" 30 "30" 36 "36" 42 "42" 48 "48" 54 "54" 60 "60", labsize(9pt) ) ///
ylabel(, labsize(9pt) format(%9.2f) angle(0)) xsize(6)
*
*
graph save "Graph" "C:\Users\gk57526\Dropbox\Administration of UI Programs in the American States (Ji-Hyeun Hong)\Performance Management Project (Paper #3)\EMPIRICS\GRAPHICS\marginsplot.Model 3.FIGURE 4D.04-10-2025.gph", replace

*
*
*
*
* [MODEL 3: RELATIVE TYPE I PROGRAM ERROR RATE] FIGURE 4E: MARGINAL DIFFERENTIAL EFFECT BETWEEN HIGH TASK COMPLEXITY (relt1_interstate_cat==2) & LOW COMPLEXITY (relt1_interstate_cat==0) VALUES [WITH RESPECT TO MONTHS SINCE ADOPTION (t + k) : 0 1 6 12.....60]: ***

margins r.relt1_interstate_cat if relt1_interstate_cat==0|relt1_interstate_cat==2, at(itmod_monthcount=(0 1 6 12 18 24 30 36 42 48 54 60))

marginsplot, recast(connected) ciopt(color(%40)) recastci(rarea) /// 
yline(0, lcolor(%40gs) lpattern(shortdash)) ///
legend(on order(1 "High Task Complexity - Low Task Complexity") pos(6) ring(2) cols(2) size(10pt))  ///
title(" {bf:FIGURE 4E}""{bf:Conditional Adaptation Marginal Effect By Task Complexity}" "{bf:(Interstate Claims: Relative Type I Program Error Rate [MODEL 3])}", size(10pt) linegap(0.7) margin(t+1 b+1 r-6)) ///
xtitle("Months since IT Reform", size(10pt) margin(t+2 b+2)) ///
ytitle("Relative Type I Program Error Rate", size(10pt) margin(r+2)) ///
xlabel(0 "0" 1 "1" 6 "6" 12 "12" 18 "18" 24 "24" 30 "30" 36 "36" 42 "42" 48 "48" 54 "54" 60 "60", labsize(9pt) ) ///
ylabel(, labsize(9pt) format(%9.2f) angle(0)) xsize(6)
*
*
*
graph save "Graph" "C:\Users\gk57526\Dropbox\Administration of UI Programs in the American States (Ji-Hyeun Hong)\Performance Management Project (Paper #3)\EMPIRICS\GRAPHICS\marginsplot.Model 3.FIGURE 4E.04-10-2025.gph", replace
*
*
*
*
*

* [MODEL 3: RELATIVE TYPE I PROGRAM ERROR RATE] FIGURE 4F: MARGINAL DIFFERENTIAL EFFECT BETWEEN HIGH TASK COMPLEXITY (relt1_diffoccupseek_cat==2) & LOW COMPLEXITY (relt1_extbenefits_cat==0) VALUES [WITH RESPECT TO MONTHS SINCE ADOPTION (t + k) : 0 1 6 12.....60]: ***

margins r.relt1_diffoccupseek_cat if relt1_diffoccupseek_cat==0|relt1_diffoccupseek_cat==2, at(itmod_monthcount=(0 1 6 12 18 24 30 36 42 48 54 60))

marginsplot, recast(connected) ciopt(color(%40)) recastci(rarea) /// 
yline(0, lcolor(%40gs) lpattern(shortdash)) ///
legend(on order(1 "High Task Complexity - Low Task Complexity") pos(6) ring(2) cols(2) size(10pt))  ///
title(" {bf:FIGURE 4F}""{bf:Conditional Adaptation Marginal Effect By Task Complexity}" "{bf:(Seeking Different Occupation: Relative Type I Program Error Rate [MODEL 3])}", size(10pt) linegap(0.7) margin(t+1 b+1 r-6)) ///
xtitle("Months since IT Reform", size(10pt) margin(t+2 b+2)) ///
ytitle("Relative Type I Program Error Rate", size(10pt) margin(r+2)) ///
xlabel(0 "0" 1 "1" 6 "6" 12 "12" 18 "18" 24 "24" 30 "30" 36 "36" 42 "42" 48 "48" 54 "54" 60 "60", labsize(9pt) ) ///
ylabel(, labsize(9pt) format(%9.2f) angle(0)) xsize(6)
*
*
*
graph save "Graph" "C:\Users\gk57526\Dropbox\Administration of UI Programs in the American States (Ji-Hyeun Hong)\Performance Management Project (Paper #3)\EMPIRICS\GRAPHICS\marginsplot.Model 3.FIGURE 4F.04-10-2025.gph", replace




*********************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************



log close
